﻿@model Commission.Models.TransactionHistory
@using MyResources = Commission.Resources.AppResource

<style type="text/css">
    dt {
        float: left;
        width: 100px;
        padding: 4px;
        text-align: left;
    }

    dd {
        margin-left: 100px;
        padding: 4px;
    }
</style>

@{
    ViewBag.Title = "Details";
}

<h2>@MyResources.LabelTransactionDetail</h2>

<div>
    <dl class="dl-horizontal">
        <dt>
            @MyResources.LabelCustomer
        </dt>

        <dd>
            @Html.ActionLink(
                Model.Customer.DisplayName,
                "Details", "Customer",
                    new { id = Model.Customer.CustomerID },
                    new { @class = "LabelNormal" })
        </dd>

        <dt>
            @MyResources.LabelAccountType
        </dt>

        <dd>
            @Html.DisplayFor(model => model.AccountType)
        </dd>

        @if (Model.AccountType == Commission.Models.AccountType.Direct
            || Model.AccountType == Commission.Models.AccountType.RollUp
            || Model.AccountType == Commission.Models.AccountType.Online
            || Model.AccountType == Commission.Models.AccountType.Matching
            || Model.AccountType == Commission.Models.AccountType.OnlinePayment
            || Model.AccountType == Commission.Models.AccountType.SignUp
            || Model.AccountType == Commission.Models.AccountType.Active
            )
        {
            <dt>
                @MyResources.LabelForCustomer
            </dt>

            <dd>
                @if (Model.SponsoredCustomer != null) { 
                    @Html.ActionLink(
                        Model.SponsoredCustomer.DisplayName,
                        "Details", "Customer",
                             new { id = Model.SponsoredCustomer.CustomerID },
                             new { @class = "LabelNormal" })
                }
            </dd>
        }

        <dt>
            @MyResources.LabelTransactionDate
        </dt>

        <dd>
            @Html.DisplayFor(model => model.CreatedAt)
        </dd>

        @if (Model.AccountType == Commission.Models.AccountType.Pairing)
        { 
        <dt>
            @MyResources.LabelPoint
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Point)
        </dd>
        }

        <dt>
            @MyResources.LabelAmount80
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Amount)
        </dd>

        <dt>
            @MyResources.LabelAmount20
        </dt>

        <dd>
            @Html.DisplayFor(model => model.ProductAmount)
        </dd>

        <dt>
            @MyResources.LabelTotal
        </dt>

        <dd>
            @Html.DisplayFor(model => model.TotalAmount)
        </dd>

        <dt>
            @MyResources.LabelDescription
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Description)
        </dd>

    </dl>
</div>
<p>
    @Html.ActionLink(@MyResources.LinkBackToList, "Index")
</p>
